<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=<?php echo config_item('charset');?>" />
<title>Administrator Control Panel</title>
<link href="<?php echo CSS_IMAGES_JS_BASE_URL;?>css/style.css" rel="stylesheet" type="text/css" />
<link href="<?php echo CSS_IMAGES_JS_BASE_URL;?>css/dropdown.css" media="screen" rel="stylesheet" type="text/css" />
<link media="screen" type="text/css" href="<?php echo CSS_IMAGES_JS_BASE_URL;?>jquery/css/validationEngine.jquery.css" rel="stylesheet" />
<link media="screen" type="text/css" href="<?php echo CSS_IMAGES_JS_BASE_URL;?>css/ajaxtabs.css" rel="stylesheet" />

<!--<script src="<?php echo CSS_IMAGES_JS_BASE_URL;?>jquery/jquery-latest.pack.js" type="text/javascript"></script>-->

<!-- Add jQuery library -->
<script type="text/javascript" src="<?php echo CSS_IMAGES_JS_BASE_URL;?>fancyapps/lib/jquery-1.7.2.min.js"></script>
<script src="<?php echo CSS_IMAGES_JS_BASE_URL;?>jquery/js/jquery.validationEngine-en.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="<?php echo CSS_IMAGES_JS_BASE_URL;?>jquery/js/jquery.validationEngine.js"></script>


<!-- Add mousewheel plugin (this is optional) -->
<script type="text/javascript" src="<?php echo CSS_IMAGES_JS_BASE_URL;?>fancyapps/lib/jquery.mousewheel-3.0.6.pack.js"></script>

<!-- Add fancyBox main JS and CSS files -->
<script type="text/javascript" src="<?php echo CSS_IMAGES_JS_BASE_URL;?>fancyapps/source/jquery.fancybox.js?v=2.0.6"></script>
<link rel="stylesheet" type="text/css" href="<?php echo CSS_IMAGES_JS_BASE_URL;?>fancyapps/source/jquery.fancybox.css?v=2.0.6" media="screen" />

<!-- Add Button helper (this is optional) -->
<link rel="stylesheet" type="text/css" href="<?php echo CSS_IMAGES_JS_BASE_URL;?>fancyapps/source/helpers/jquery.fancybox-buttons.css?v=1.0.2" />
<script type="text/javascript" src="<?php echo CSS_IMAGES_JS_BASE_URL;?>fancyapps/source/helpers/jquery.fancybox-buttons.js?v=1.0.2"></script>

<!-- Add Thumbnail helper (this is optional) -->
<link rel="stylesheet" type="text/css" href="<?php echo CSS_IMAGES_JS_BASE_URL;?>fancyapps/source/helpers/jquery.fancybox-thumbs.css?v=1.0.2" />
<script type="text/javascript" src="<?php echo CSS_IMAGES_JS_BASE_URL;?>fancyapps/source/helpers/jquery.fancybox-thumbs.js?v=1.0.2"></script>

<!-- Add Media helper (this is optional) -->
<script type="text/javascript" src="<?php echo CSS_IMAGES_JS_BASE_URL;?>fancyapps/source/helpers/jquery.fancybox-media.js?v=1.0.0"></script>

<link media="screen" type="text/css" href="<?php echo CSS_IMAGES_JS_BASE_URL;?>jquery/jquery-ui.css" rel="stylesheet" />
<script src="<?php echo CSS_IMAGES_JS_BASE_URL;?>jquery/jquery-ui-1.8.2.custom.min.js" type="text/javascript"></script>

<script language="JavaScript" type="text/javascript" src="<?php echo CSS_IMAGES_JS_BASE_URL;?>js/adminEssential.js"></script>

<!--[if lt IE 7]>
<script type="text/javascript" src="<?php echo CSS_IMAGES_JS_BASE_URL;?>jquery/jquery.js"></script>
<script type="text/javascript" src="<?php echo CSS_IMAGES_JS_BASE_URL;?>jquery/jquery.dropdown.js"></script>
<![endif]-->
<script type="text/JavaScript">
<!--
var hostname = '<?php echo base_url(); ?>';
var base_url = '<?php echo front_base_url();?>public/';
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

jQuery(document).ready(function($){
	jQuery( "#admin" ).fadeToggle('slow', "linear");

});
//-->
</script>
<link rel="stylesheet" href="<?php echo CSS_IMAGES_JS_BASE_URL;?>jquery/css/jquery-ui.css" type="text/css" media="screen" title="Flora (Default)">
<script  src="<?php echo CSS_IMAGES_JS_BASE_URL;?>jquery/jquery-ui.min.js"></script>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="100%" align="center" valign="top" class="header"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td align="left" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
              <tr>
                <td align="left" valign="top"></td>
              </tr>
              <tr>
                <td valign="top" align="left" style="padding-bottom:10px;"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr bgcolor="#000000">                   
                      <td style="padding:5px 10px;background-color:#FFFFFF;"><a href="<?php echo base_url();?>"><img src="<?php echo file_upload_base_url()?>logo_image/logo.png" title="LeagueGuru"/></a></td>
                      <td width="100%" align="right" valign="middle" style="background-color:#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td width="4%" align="left"></td>
                            <td width="22%">&nbsp;</td>
                            <td width="23%"></td>
                            <td width="51%" align="right" style="padding:5px 15px;"><table border="0" cellspacing="0" cellpadding="0" align="right">                            	
                                <tr>                                
                                  <td align="right" nowrap="nowrap" class="textHeader" style="color:#000000;">Welcome <?php echo ucfirst($this->nsession->userdata('user_session_username'));?>, It&rsquo;s <?php echo  date("M d,Y H:i");?> </td>
                                </tr>
                                <tr>
                                  <td align="right" class="textHeader" style="padding-top:10px;color:#000000;"><a href="<?php echo front_base_url();?>" target="_blank" class="text9"><b>Store Front</b></a> | <a href="javascript:logout('<?php echo base_url();?>logout/');"  class="text9" ><b><?php echo lang('logout'); ?></b></a> </td>
                                </tr>
                              </table></td>
                          </tr>
                      </table></td>
                    </tr>
                  </table></td>
              </tr>
              <tr>
                <td align="left" valign="top" class="navigation-cont" ><?php echo $content_for_layout_menu;?></td>
              </tr>
            </table></td>
        </tr>
        <!--<tr>
          <td height="10"></td>
        </tr>-->
      </table></td>
  </tr>
  <tr>
    <td align="left" valign="top" id='admin' style="height:370px; *height:370px; padding:5px;display:none;"><?php echo $content_for_layout_main;?></td>
  </tr>
  <tr>
    <td align="left" valign="top"><div class="footer-cont">
        <div class="footer"> &copy; <?php echo date("Y");?>&nbsp;&nbsp;&nbsp;<?php echo GLOBAL_SITE_NAME; ?>;&nbsp;&nbsp; All rights reserved. &nbsp;&nbsp;Execution Time: {elapsed_time} &nbsp;&nbsp;Memory Consumption: {memory_usage}</div>
      </div></td>
  </tr>
</table>
<script language="javascript">
////jQuery for availability checking////

function availability_check(fieldid,url){
	    var error=jQuery('#form1').validationEngine('validateField', '#'+fieldid+'');

	   if(error==false)
	   {
		   var value=$('#'+fieldid+'').val();

		   $('#msg_'+fieldid+'').html('<img src="<?php echo CSS_IMAGES_JS_BASE_URL;?>images/loading.gif" align="absmiddle">&nbsp;Checking availability...');

		   $.post(url,{value:value},function(data)
		   {
		     if(data>0)
			 {
				  $('#'+fieldid+'').removeClass('object_ok'); // if necessary
				  $('#'+fieldid+'').addClass("object_error");
				 
				  $('#msg_'+fieldid+'').html('<br>&nbsp;<font color="red"><strong>'+value+' is not available</strong></font>');
				  $('#'+fieldid).val('');
				   $('#'+fieldid).focus().delay(3000).blur();
				  $('input[type="submit"]').attr("disabled", true);
			  }
			 else
			 {
				  $('#'+fieldid+'').removeClass('object_error'); // if necessary
				  $('#'+fieldid+'').addClass("object_ok");
				  $('#msg_'+fieldid+'').html('&nbsp;<a href="javascript:;"><img src="<?php echo CSS_IMAGES_JS_BASE_URL;?>images/tick_icon.png" alt="" border="0"></a>');
				  $('.normal-bttn').attr("disabled", false);
			 }
			});
		}
		else
		{
			 $('#msg_'+fieldid+'').html('');
			 $('#'+fieldid+'').removeClass('object_error');
			 $('#'+fieldid+'').removeClass('object_ok');
		}
	}

//////////////////////////////////end///////////////////////////////////////
jQuery('#checkAllAuto').click(function(){
	jQuery("INPUT[name='check_box'][type='checkbox']").attr('checked', jQuery('#checkAllAuto').is(':checked'));
});
jQuery("INPUT[name='check_box'][type='checkbox']").click(function(){
	var all_checked = false;
	jQuery("INPUT[name='check_box'][type='checkbox']").each(function(){
		if(jQuery(this).is(':checked')){
			all_checked = true;
		}else{
			all_checked = false;
			return all_checked;
		}
	});
	jQuery("#checkAllAuto").attr('checked', all_checked);
});

function Delete_all(action_url)
{
	var val = '';
	var arr = jQuery("INPUT[name='check_box'][type='checkbox']:checkbox:checked");
	arr.each(function(i){

	var is_last_item = (i == (arr.length - 1));

	  if(jQuery(this).val()!='Yes')
		  val = val+jQuery(this).val();

	  if(is_last_item == false)
	    val = val+'^';
	});

	if(val==''){
		alert("Please select atleast one Item!");
		//jq_alert("Please select atleast one Item!");
		return false;
	}else{
		if(confirm("Are you sure to delete the selected items")){
			document.fromCheckAction.check_ids.value = val;
			document.fromCheckAction.action = hostname+action_url;
			document.fromCheckAction.submit();
		}
	}
}

function Active_all(action_url)
{
	var val = '';
	jQuery("INPUT[name='check_box'][type='checkbox']:checkbox:checked").each(function(i){
	  if(jQuery(this).val()!='Yes')
		  val = val+jQuery(this).val()+'^';
	});

	if(val==''){
		alert("Please select atleast one Item!");
		//jq_alert("Please select atleast one Item!");
		return false;
	}else{
		//if(jq_confirm("Are you sure to change the status of the selected items to active")){
		if(confirm("Are you sure to change the status of the selected items to active")){
			document.fromCheckAction.check_ids.value = val;
			document.fromCheckAction.action = hostname+action_url;
			document.fromCheckAction.submit();
		}
	}
}

function Inactive_all(action_url)
{
	var val = '';
	jQuery("INPUT[name='check_box'][type='checkbox']:checkbox:checked").each(function(i){
	  if(jQuery(this).val()!='Yes')
		  val = val+jQuery(this).val()+'^';
	});

	if(val==''){
		alert("Please select atleast one Item!");
		//jq_alert("Please select atleast one Item!");
		return false;
	}else{
		//if(jq_confirm("Are you sure to change the status of the selected items to inactive")){
		if(confirm("Are you sure to change the status of the selected items to inactive")){
			document.fromCheckAction.check_ids.value = val;
			document.fromCheckAction.action = hostname+action_url;
			document.fromCheckAction.submit();
		}
	}
}

function Trash_all(action_url)
{
	var val = '';
	jQuery("INPUT[name='check_box'][type='checkbox']:checkbox:checked").each(function(i){
	  if(jQuery(this).val()!='Yes')
		  val = val+jQuery(this).val()+'^';
	});

	if(val==''){
		alert("Please select atleast one Item!");
		//jq_alert("Please select atleast one Item!");
		return false;
	}else{
		//if(jq_confirm("Are you sure to change the status of the selected items to inactive")){
		if(confirm("Are you sure to send of the selected items to Trash")){
			document.fromCheckAction.check_ids.value = val;
			document.fromCheckAction.action = hostname+action_url;
			document.fromCheckAction.submit();
		}
	}
}

function Restore_all(action_url)
{
	var val = '';
	jQuery("INPUT[name='check_box'][type='checkbox']:checkbox:checked").each(function(i){
	  if(jQuery(this).val()!='Yes')
		  val = val+jQuery(this).val()+'^';
	});

	if(val==''){
		alert("Please select atleast one Item!");
		//jq_alert("Please select atleast one Item!");
		return false;
	}else{
		//if(jq_confirm("Are you sure to change the status of the selected items to inactive")){
		if(confirm("Are you sure to restore the selected items")){
			document.fromCheckAction.check_ids.value = val;
			document.fromCheckAction.action = hostname+action_url;
			document.fromCheckAction.submit();
		}
	}
}
</script>
<?php if(isset($succmsg) && $succmsg<>'') { ?>
<script>
	jQuery(function() {
		// a workaround for a flaw in the demo system (http://dev.jqueryui.com/ticket/4375), ignore!
		//jQuery( "#dialog:ui-dialog" ).dialog( "destroy" );
		jQuery("#dialog-modal" ).dialog({
			height: 200,
			width: 550,
			show: "puff",
			hide: "explode",
			buttons: {
				Ok: function() {
					jQuery( this ).dialog( "close" );
				}
			},
			modal: true
		});
	});
	</script>
<div id="dialog-modal" title="Success Message" style="display:none;">
	<p><img src="<?php echo CSS_IMAGES_JS_BASE_URL;?>images/dialog-warning.png" style="float:left; margin:5px;" /><?php echo $succmsg;?></p>
</div>

<?php }if(isset($errmsg) && $errmsg<>'') { ?>
<script>
	jQuery(function() {
		// a workaround for a flaw in the demo system (http://dev.jqueryui.com/ticket/4375), ignore!
		//jQuery( "#dialog:ui-dialog" ).dialog( "destroy" );
		jQuery( "#dialog-modal" ).dialog({
			height: 200,
			width: 550,
			show: "puff",
			hide: "explode",
			buttons: {
				Ok: function() {
					jQuery( this ).dialog( "close" );
				}
			},
			modal: true
		});
	});
	</script>

<div id="dialog-modal" title="Error Message" style="display:none;">
	<p><img src="<?php echo CSS_IMAGES_JS_BASE_URL;?>images/dialog-error.png" style="float:left; margin:5px;" /><?php echo $errmsg;?></p>
</div>

<?php }?>

<form name="fromCheckAction" id="fromCheckAction" action="" method="post">
  <input type="hidden" name="check_ids" id="check_ids" value="" />
</form>

<script type="text/javascript">
function doShowHideLoader(theAction)
{
	var h = jQuery(document).height();
	var w = jQuery(document).width();
	jQuery("#loading-mask").css("height",h+"px");
	jQuery("#loading-mask").css("width",w+"px");
	if(theAction == 'show'){
		jQuery("#loading-mask").show();
	}
	else if(theAction == 'hide'){
		jQuery("#loading-mask").hide();
		//jQuery(".menu a").css("background", "#E3E3E3")
	}
}

function jq_alert(msg)
{
	var okLabel = 'Ok';

	var buttons = {};
	buttons[okLabel] = function() {
		jQuery(this).dialog("close");
		return false;
	};

	jQuery( "#msg_box_alert" ).dialog( "destroy" );
	jQuery( "#msg_box_alert" ).dialog({
		height: 200,
		width: 550,
		show: "puff",
		hide: "explode",
		modal: true,
		buttons: buttons,
		open: function(event, ui) {
			jQuery("#alert_msg").html(msg);
		},
		close: function(){
			jQuery("#alert_msg").html('');
		}

	});
}

function jq_confirm(msg,event){
	if (!jQuery(this).data("IsConfirmed")){
		jQuery("#msg_box_confirm").data("button", this);
		jQuery("#msg_box_confirm").dialog('open');
		jQuery("#confirm_html").html(msg);
		return false;
	} else {
		jQuery(this).data("IsConfirmed", false);
		return true;
	}
}

/*jQuery(function() {
	jQuery("#msg_box_confirm").dialog({
		modal: true,
		autoOpen: false,
		buttons: {
			'Ok': function(event) {
				jQuery(this).dialog('close');
				var button = jQuery(this).data("button");
				jQuery(button).data("IsConfirmed",true);
				jQuery(".confirm_input").click();
			},
			Cancel: function() {
				jQuery(this).dialog('close');
			}
		}
	});
	jQuery(".confirm_input").data("IsConfirmed",false).bind("click",{ }, openDialog);
}); */


function jq_confirm11(msg)
{
	var okLabel = 'Ok';
	var cancelLabel = 'Cancel';

	var buttons = {};
	buttons[okLabel] = function(event) {
		jQuery(this).dialog("close");
		var button = jQuery(this).data("button");
		jQuery(button).data("IsConfirmed",true);
		button.click();
	};
	buttons[cancelLabel] = function() {
		jQuery(this).dialog("close");
		return false;
	};

	jQuery( "#msg_box_confirm" ).dialog( "destroy" );
	jQuery( "#msg_box_confirm" ).dialog({
		height: 200,
		width: 550,
		show: "puff",
		hide: "explode",
		modal: true,
		open: function(event, ui) {
			jQuery("#confirm_html").html(msg);
		},
		buttons: buttons,
		close: function(){
			jQuery("#confirm_html").html('');
		}

	});
}
</script>
<div id="msg_box_alert" title="Alert" style="display:none;">
	<p><img src="<?php echo CSS_IMAGES_JS_BASE_URL;?>images/dialog-warning.png" style="float:left; margin:5px;" /><div id="alert_msg"></div></p>
</div>
<div id="msg_box_confirm" title="Confirm" style="display:none;">
	<p><img src="<?php echo CSS_IMAGES_JS_BASE_URL;?>images/dialog-confirm.png" style="float:left; margin:5px;" /><div id="confirm_html"></div></p>
</div>
<div style="left: 0px; top: 0px; display: none;" id="loading-mask">
    <p id="loading_mask_loader" class="loader"><img alt="Loading..." src="<?php echo CSS_IMAGES_JS_BASE_URL;?>images/loading.gif"><br>Please wait...</p>
</div>
</body>
</html>
